package com.zxl.study.controller;

import com.zxl.study.model.vo.MetaDatabaseTreeAggResultVo;
import com.zxl.study.service.MetaDatabaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.IOException;

@RequestMapping("/meta/database")
@RestController
@Slf4j
public class MetaDatabaseController {
    @Resource
    private MetaDatabaseService metaDatabaseService;
    @GetMapping("/tables/remote/aggTree")
    public MetaDatabaseTreeAggResultVo getRemoteTablesAggTree() throws IOException {
        return metaDatabaseService.getRemoteTablesAggTree();
    }

    @DeleteMapping
    public void deletedDatabase() {
        metaDatabaseService.deletedDatabase();
    }

}
